﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;
using DTO;

namespace BLL
{
    public class NguoiNhanHangBLL
    {
        #region Khai báo
        private NguoiNhanHangDAL _nnhDAL;
        #endregion

        #region Khởi tạo
        public NguoiNhanHangBLL()
        {
            _nnhDAL = new NguoiNhanHangDAL();
        }
        #endregion

        #region GetListNguoiNhanHangTheoMaKhachHang
        public List<NguoiNhanHangDTO> usp_GetListNguoiNhanHangTheoMaKhachHang(string makhachhang)
        {
            try
            {
                return _nnhDAL.usp_GetListNguoiNhanHangTheoMaKhachHang(makhachhang);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion

        #region GetListNguoiNhanHang
        public List<NguoiNhanHangDTO> GetListNguoiNhanHang()
        {
            try
            {
                return _nnhDAL.GetListNguoiNhanHang();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion

        #region GetNguoiNhanHang
        public NguoiNhanHangDTO GetNguoiNhanHang(string manguoinhanhang)
        {
            return _nnhDAL.GetNguoiNhanHang(manguoinhanhang);
        }
        #endregion

        #region ThemNguoiNhanHang
        public int ThemNguoiNhanHang(NguoiNhanHangDTO nnhDTO)
        {
            try
            {
                return _nnhDAL.themNguoiNhanHang(nnhDTO);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion
    }
}